from sqlalchemy import Column, ForeignKey, DateTime
from sqlalchemy.dialects.oracle import VARCHAR2, NUMBER
from sqlalchemy.orm import relationship
from app.db.base import Base
from datetime import datetime, timezone


class Role(Base):
    __tablename__ = "ROLES"
    __table_args__ = {'schema': 'COOP_APP'}

    role_id = Column(NUMBER, primary_key=True, index=True)
    role_name = Column(VARCHAR2(100), unique=True, nullable=False)
    description = Column(VARCHAR2(255), nullable=True)

    users = relationship("User", back_populates="role")
